﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using sx_windows.utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace sx_windows.data.repository.source
{
    public class FetchResult
    {
        public int code;
        public JObject data;
        public string message;
        public bool isSuccess {
            get { return code == 1; }
        }
        private FetchResult()
        {

        }
        public static FetchResult Instance(string data,long timestamp)
        {
            FetchResult result = new FetchResult();
            data = Des.Decrypt(data,timestamp);
            if (data == null)
            {
                return result;
            }
            result = JsonConvert.DeserializeObject<FetchResult>(data);
            return result;
        }
    }
}
